#ifndef CHALLENGEROOM_H
#define CHALLENGEROOM_H

#include <QWidget>
#include <QMessageBox>
#include "ui_challengeroom.h"
#include "passivechallengedialog.h"
#include "activechallengedialog.h"

class ChallengeRoom : public QWidget
{
    Q_OBJECT
public:
    ChallengeRoom(QWidget *parent = 0);
    ~ChallengeRoom();
    void closeAll();

signals:
    void logout();
    void challengePlayer(QString player);
    void challengeByPlayerAccepted(QString player);
    void challengeByPlayerDeclined(QString player);
    void cancelChallenge();
private slots:
    void prepChallenge();
    void acceptChallengeByPlayer();
    void declineChallengeByPlayer();
    void cancelChallengePrep();
    void handleChallengeDeclined();
public slots:
    void updatePlayerList(QList<QString> players);
    void challengedBy(QString);
    void handleNoChallenges();
    void handleChallengeDeliveryFailure(QString player);
    void challengeDelivered(QString);
private:
    QMessageBox *messageBox;
    Ui::ChallengeRoom *ui;
    PassiveChallengeDialog *challengeDialog;
    ActiveChallengeDialog *activeChallengeDialog;
    QString opponent;
};

#endif // CHALLENGEROOM_H
